package com.krain.ddbb.entity;

import android.os.Parcel;
import android.os.Parcelable;

import com.krain.corelibrary.entity.ImageItem;

import java.sql.Date;
import java.util.ArrayList;
import java.util.Arrays;

/**
 * Created by ex-kuangxiaomin101 on 2016-01-04.
 */
public class PlaceOrderBean implements Parcelable {

    private int work_id;
    private Long server_time;
    private Double server_price;
    private int server_address;
   // private String[] order_image = new String[5];
    private ArrayList<ImageItem> order_image;
    private String desc;

    public int getWork_id() {
        return work_id;
    }

    public void setWork_id(int work_id) {
        this.work_id = work_id;
    }

    public Long getServer_time() {
        return server_time;
    }

    public void setServer_time(Long server_time) {
        this.server_time = server_time;
    }

    public Double getServer_price() {
        return server_price;
    }

    public void setServer_price(Double server_price) {
        this.server_price = server_price;
    }

    public int getServer_address() {
        return server_address;
    }

    public void setServer_address(int server_address) {
        this.server_address = server_address;
    }

    public ArrayList<ImageItem> getOrder_image() {
        return order_image;
    }

    public void setOrder_image(ArrayList<ImageItem> order_image) {
        this.order_image = order_image;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }


    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(this.work_id);
        dest.writeValue(this.server_time);
        dest.writeValue(this.server_price);
        dest.writeInt(this.server_address);
        dest.writeTypedList(order_image);
        dest.writeString(this.desc);
    }

    public PlaceOrderBean() {
    }

    protected PlaceOrderBean(Parcel in) {
        this.work_id = in.readInt();
        this.server_time = (Long) in.readValue(Long.class.getClassLoader());
        this.server_price = (Double) in.readValue(Double.class.getClassLoader());
        this.server_address = in.readInt();
        this.order_image = in.createTypedArrayList(ImageItem.CREATOR);
        this.desc = in.readString();
    }

    public static final Creator<PlaceOrderBean> CREATOR = new Creator<PlaceOrderBean>() {
        public PlaceOrderBean createFromParcel(Parcel source) {
            return new PlaceOrderBean(source);
        }

        public PlaceOrderBean[] newArray(int size) {
            return new PlaceOrderBean[size];
        }
    };

    @Override
    public String toString() {
        return "PlaceOrderBean{" +
                "work_id=" + work_id +
                ", server_time=" + server_time +
                ", server_price=" + server_price +
                ", server_address=" + server_address +
                ", order_image=" + order_image +
                ", desc='" + desc + '\'' +
                '}';
    }
}
